﻿@model Fap.AspNetCore.ViewModel.JqGridViewModel
@using Fap.AspNetCore.Controls.JqGrid
@{
    var execStatusList = _dbContext.Dictionarys("RcrtExecStatus");
}
<title>
    <fap-multilang lang-key="job_demand" default-content="职位需求"></fap-multilang>
</title>

<div class="row">
    <div class="col-xs-12">
        <div class="widget-box">
            <div class="widget-header widget-header-flat">
                <h4 class="widget-title">
                    <fap-multilang lang-key="job_demand" default-content="职位需求"></fap-multilang>
                </h4>

                <div class="widget-toolbar">
                    <a href="#" data-action="fullscreen" class="orange2">
                        <i class="ace-icon fa fa-expand"></i>
                    </a>
                </div>
                <div class="widget-toolbar">
                    <fap-button id="btnResumeFilter" btn-tag="link" content="简历筛选" icon-before="fa fa-filter blue" class-name="info"></fap-button>
                    <fap-button id="btnDemandApply" btn-tag="link" content="招聘职位申请" icon-before="fa fa-plus blue" class-name="info"></fap-button>
                </div>
            </div>
            <div class="widget-body">

                <div class="widget-main">
                    <fap-grid id="rcrtdemand" grid-model="Model" wrapper="widget-main" register-authority="false" oper-chart="true" view-records="true" shrink-fit="false"></fap-grid>

                    <!-- /.row -->
                </div>
            </div>
        </div>
    </div>
</div>
<script>

    var scripts = [null, "/Scripts/Workflow/business.js?v=2", null]
    $('.page-content-area').ace_ajax('loadScripts', scripts, function () {
        jQuery(function ($) {
            $(document).one('ajaxloadstart.page', function (e) {
            })
            $("#btnDemandApply").on(ace.click_event, function () {
                let initData = {
                    DeptUid: '@_applicationContext.DeptUid',
                    DeptCode:'@_applicationContext.DeptCode',
                    DeptUidMC: '@Html.Raw(_applicationContext.DeptName)',
                    Leader: '@_applicationContext.EmpUid',
                    LeaderMC: '@Html.Raw(_applicationContext.EmpName)'
                };
                applyBusiness('3577655145439166464', "招聘职位申请", initData);
            })
            $("#btnResumeFilter").on(ace.click_event, function () {
                var rw = getSelectedRow("grid-rcrtdemand");
                if (rw === null) {
                    return;
                }
                bootboxWindow1($.lang("resume_filter", "简历筛选"), basePath + "/Recruit/Manage/DeptResume", {
                    resumeAssess: {
                        label: $.lang("resume_assess", "简历评估"),
                        className: "btn-primary btn-link",
                        callback: function () {
                            resumeAssess();
                            return false;
                        }
                    },   
                    interviewAssess: {
                        label: $.lang("view_interview_assess", "查看面试评价"),
                        className: "btn-primary btn-link",
                        callback: function () {
                            interviewAssess();
                            return false;
                        }
                    },  
                    talentPool: {
                        label: $.lang("talent_pool", "加优才库"),
                        className: "btn-primary btn-link",
                        callback: function () {
                            setResumeStatus('TalentPool');
                            return false;
                        }
                    },
                    remove: {
                        label: $.lang("reserve", "加后备人才库"),
                        className: "btn-primary btn-link",
                        callback: function () {
                            setResumeStatus('Reserve');
                            return false;
                        }
                    }
                 
                }, { title: rw.DemandName });
            })
        })
    })

</script>
